#ifndef _FRACTAL_COLORMAP_H
#define _FRACTAL_COLORMAP_H


#include <complex>


using namespace std;


struct Colormap
{
    int max_iter;

    Colormap(int max_iter=0);
    virtual void gen_color(int iter_num, const complex<double> &pos,
			   float &r, float &g, float &b) const = 0;
};


struct ColormapRed: public Colormap
{
    ColormapRed(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos,
		   float &r, float &g, float &b) const;
};


struct ColormapZebra: public Colormap
{
    ColormapZebra(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos,
		   float &r, float &g, float &b) const;
};


struct ColormapMndClassic: public Colormap
{
    ColormapMndClassic(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos,
		   float &r, float &g, float &b) const;
};


struct ColormapLevel: public Colormap
{
    ColormapLevel(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos, 
		   float &r, float &g, float &b) const;
};


struct ColormapLevelLog: public Colormap
{
    ColormapLevelLog(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos, 
		   float &r, float &g, float &b) const;
};


struct ColormapNewton3: public Colormap
{
    ColormapNewton3(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos, 
		   float &r, float &g, float &b) const;

private:
    complex<double> _roots[3];
};


struct ColormapNewton3Lvl: public Colormap
{
    ColormapNewton3Lvl(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos, 
		   float &r, float &g, float &b) const;

private:
    complex<double> _roots[3];
};


struct ColormapNewton3LvlLog: public Colormap
{
    ColormapNewton3LvlLog(int max_iter=0);

    void gen_color(int iter_num, const complex<double> &pos, 
		   float &r, float &g, float &b) const;

private:
    complex<double> _roots[3];
};


#endif  // _FRACTAL_COLORMAP_H
